<?php
$q=$_GET["q"];

$con = mysql_connect('localhost', 'root', '');
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("ProjectDatabase", $con);

//$sql="SELECT * FROM Diagram WHERE svgXML = '".$q."'";
$sql = "INSERT INTO user (svgXML) VALUES ('".$q[0]."')";
$sql = "INSERT INTO diagram (userid) VALUES ('".$q[0]."')";

$result = mysql_query($sql);

echo $result;
mysql_close($con);
?>
